# -*- encoding: utf-8 -*-
"""

PyCharm 冲激信号
2024年 10月 31日 14:29
coded by wenyang
文件的主要内容


"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl


def main():
    mpl.rcParams["font.sans-serif"] = ["SimHei"]
    mpl.rcParams["axes.unicode_minus"] = False
    Fs = 1000
    x = np.linspace(-1, 1, 2 * Fs + 1)
    y = np.zeros(x.shape)
    y[x == 0] = 1
    plt.plot(x, y, lw = 2, color = "g", ls = ":", label = "冲激信号")
    plt.legend()
    plt.title("冲激信号展示")
    plt.xlabel("时间(s)")
    plt.ylabel("冲击强度")
    plt.show()


if __name__ == "__main__":
    main()
